﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mail;
using System.Net;
using System.Web;


namespace Equipment_manage.Models
{
    public class SendEMail
    {
        public static void Send(string ToEMail,string title,string content)
        {
            MailAddress mailadd = new MailAddress("c475570815@163.com");

            MailMessage mailmessage = new MailMessage();
            mailmessage.From = mailadd;

            mailmessage.To.Add(ToEMail);
            mailmessage.CC.Add("c475570815@163.com");

            mailmessage.Subject = title;
            mailmessage.Body = content;


            SmtpClient client = new SmtpClient("smtp.163.com");
            client.UseDefaultCredentials = true;
            client.Credentials = new NetworkCredential("c475570815", "yxdnmm123321");
            client.EnableSsl = true;
            client.Send(mailmessage);
        }
    }
}